package com.example.qsindusty.jmm_spline.MoreSetFramgent;


import android.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.example.qsindusty.jmm_spline.LoginActivity.LoginActivity;
import com.example.qsindusty.jmm_spline.R;
import com.yixin.ystartlibrary.base.BaseFragment;
import com.yixin.ystartlibrary.utils.GeneralPreferencesUtils;
import com.yixin.ystartlibrary.utils.Utils;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link SetFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class SetFragment extends BaseFragment {


    @BindView(R.id.login_out)
    Button loginOut;
    Unbinder unbinder;

    public SetFragment() {
        // Required empty public constructor
    }


    // TODO: Rename and change types and number of parameters
    public static SetFragment newInstance() {
        SetFragment fragment = new SetFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_set, container, false);
        unbinder = ButterKnife.bind(this, view);
        return view;
    }

    @Override
    protected int getContextView() {
        return 0;
    }

    @Override
    protected void init() {

    }

    @Override
    protected void initBundleData() {

    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick(R.id.login_out)
    public void onViewClicked() {
        Utils.startIntent(getActivity(), LoginActivity.class);
        GeneralPreferencesUtils.setSharedPreference(getActivity(),"token",null);
    }
}
